package com.chat.module.message.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.comment.config.dao.typeHandler.SetLongHandler;
import com.comment.pojo.domain.chat.WsMessage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Set;

@ApiModel("聊天记录")
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ChatInfoLog extends Model<ChatInfoLog> {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("会话id")
    private Long id;

    @ApiModelProperty("人员")
    @TableField(typeHandler = SetLongHandler.class)
    private Set<Long> userIds;

    @ApiModelProperty("相关留言")
    @TableField(typeHandler = SetLongHandler.class)
    public Set<Long> messageIds;

    @ApiModelProperty("相关留言")
    @TableField(exist = false)
    public Set<WsMessage> messageInfo;
}
